package com.smgeek.gkrpc.sever;

import com.smgeek.gkrpc.Request;
import com.smgeek.gkrpc.common.utils.ReflectionUtils;

/**
 * @ClassName ServiceInvoker
 * @Author wuyuyang
 * @Date 2022/1/7 10:11
 * @Description ServiceInvoker 调用具体的服务
 * @Version 1.0
 */
public class ServiceInvoker {
    public Object invoke(ServiceInstance service, Request request){
        return ReflectionUtils.invoke(
                service.getTarget(),
                service.getMethod(),
                request.getParameters()
        );
    }
}
